<template>
    <div>
        <folder v-for="item in data.content" v-bind:key="item.id" :name="item.name" :id="item.id" :level="item.level" @click="handleFolderClick"></folder>
    </div>
</template>

<script>
import Folder from '../components/Folder'
export default {
    name:'Root',
    components:{Folder},
    data:function() {
        return{
            data:{
                content:[
                    {
                        name:'基础教学资源子库',
                        id:1
                    },
                    {
                        name:'实践项目资产子库',
                        id:2
                    }
                ]
            },
        }
    },
    methods:{
        handleFolderClick:function(name,id) {
            this.$store.commit('nextLevel',id);
            this.$router.push({ path: 'list',query:{'id':id} });
            return;
        }
    }
}
</script>

<style lang="scss" scoped>
</style>